package com.orcamento.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import org.hibernate.annotations.Parameter;
import org.hibernate.annotations.Type;
import org.joda.time.DateTime;

@Entity
@Table(name="Patrimonio")
public class Account {

	@Id
	@SequenceGenerator(name = "heritage_id", sequenceName = "heritage_id")
	@GeneratedValue(generator = "heritage_id", strategy = GenerationType.AUTO)
	@Column(name="IDPatrimonio")
	private Long id;
	@Column(name="StNome", nullable=false)
	private String name;
	@Column(name="DtInicio", nullable=false)
	@Type(
			type="org.jadira.usertype.dateandtime.joda.PersistentDateTime", 
			parameters = { 
					@Parameter(name = "databaseZone", value = "jvm"),
					@Parameter(name = "javaZone", value = "jvm")
			}
		 )
	private DateTime startDate;
	@Column(name="StLogin", unique=true, nullable=false)
	private String login;
	@Column(name="StSenha", nullable=false)
	private String password;
	@Column(name="BoStatus", nullable=false, columnDefinition="boolean default true")
	private Boolean status;
	
	public Account() {
		this.status = Boolean.TRUE;
		this.startDate = new DateTime();
	}
	
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public DateTime getStartDate() {
		return startDate;
	}
	public void setStartDate(DateTime startDate) {
		this.startDate = startDate;
	}
	public String getLogin() {
		return login;
	}
	public void setLogin(String login) {
		this.login = login;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public Boolean getStatus() {
		return status;
	}
	public void setStatus(Boolean status) {
		this.status = status;
	}

}
